#ifndef ADVDSPROFILE_DEFAULTSTATE_HPP
#define ADVDSPROFILE_DEFAULTSTATE_HPP

#include "State.hpp"
#include "../TweenObjects.hpp"
#include "../TopInformations.hpp"
#include <cpp3ds/Graphics/Sprite.hpp>
#include <cpp3ds/Graphics/Texture.hpp>
#include <cpp3ds/System/Clock.hpp>
#include <cpp3ds/Graphics/RectangleShape.hpp>
#include <TweenEngine/TweenManager.h>
#include <cpp3ds/Audio/SoundBuffer.hpp>
#include <cpp3ds/Audio/Sound.hpp>
#include <cpp3ds/Audio/Music.hpp>

namespace AdvDSProfile {

class DefaultState : public State
{
public:
	DefaultState(StateStack& stack, Context& context, StateCallback callback);
	~DefaultState();

	virtual void renderTopScreen(cpp3ds::Window& window);
	virtual void renderBottomScreen(cpp3ds::Window& window);
	virtual bool update(float delta);
	virtual bool processEvent(const cpp3ds::Event& event);

private:
	util3ds::TweenText m_textUsername;
	util3ds::TweenText m_textMessage;
	util3ds::TweenText m_textBirthday;
	util3ds::TweenRectangleShape m_separator;

	util3ds::TweenRectangleShape m_buttonUsername;
	util3ds::TweenText m_textUsernameBtn;
	util3ds::TweenRectangleShape m_buttonMessage;
	util3ds::TweenText m_textMessageBtn;
	util3ds::TweenRectangleShape m_buttonBdayDay;
	util3ds::TweenText m_textBdayDayBtn;
	util3ds::TweenRectangleShape m_buttonBdayMonth;
	util3ds::TweenText m_textBdayMonthBtn;

	util3ds::TweenText m_textChangeMode;
	util3ds::TweenText m_textAdvDSProfile;

	std::vector<std::shared_ptr<util3ds::TweenRectangleShape>> m_colorBlocks;
	util3ds::TweenText m_textPickColor;

	void updateUsernameText();
	void updateMessageText();
	void updateBirthdayText();
	void updateColors();

	void changeMode(bool defaultMode);
	bool m_isDefaultMode;

	cpp3ds::Color m_colorTheme;

	TopInformations m_topInfos;

	TweenEngine::TweenManager m_tweenManager;
};

extern DefaultState *g_defaultState;

} // namespace AdvDSProfile

#endif // ADVDSPROFILE_DEFAULTSTATE_HPP
